/******************************************************************************
 *
 * @copyright:          Copyright 2011 UniSky Ltd.
 * @file:
 * @author:              kenping.liu
 * @creation:
 * @description:
 *
 * @modifications
 * date         user                description
 *
 *
 * @more-details
 *
 *****************************************************************************/
#ifndef _UNISKY_MOBILE_CODEC_H_
#define _UNISKY_MOBILE_CODEC_H_

#include "../u_util.h"

U_NAMESPACE_BEGIN(u)
U_NAMESPACE_BEGIN(m)

enum {SVR_PORT_TRANSFER=20011, SVR_PORT_STREAMER=20012, SVR_PORT_PORTAL=20013, SVR_PORT_PGMLIST=20014};

//<transfer-req cmd="3">
//    <param name="chn_id" value="1" />
//    <param name="play_id" value="1" />
//    <param name="rectm" value="1" />
//    <param name="bitrate" value="1" />
//    <param name="file_id" value="1" />
//    <param name="src" value="1" />
//</transfer-req>
typedef struct _u_st_codec_req_
{
    UINT            cmd;
    UINT            chn_id;
    UINT            play_id;
    u::util::U_TIME rectm;
    char            bitrate[16];
    char            file_id[32];
    char            src[MAX_PATH];
}CODEC_REQ;

enum { REQ_ENCODE=0x0001, REQ_PUBLISH=0x0002, REQ_SIZE=sizeof(CODEC_REQ)+TLV_V_OFFSET};

class Codec
{
public:
    static bool send_req(CODEC_REQ* codec, const char* svr_ip="192.168.82.112");
};

U_NAMESPACE_END(m)
U_NAMESPACE_END(u)

#endif
